//
//  HMDidTreatTableViewController.m
//  仿真开发
//
//  Created by jieChen on 17/3/25.
//  Copyright © 2017年 B.HOPE. All rights reserved.
//

#import "HMDidTreatTableViewController.h"
#import "MJRefresh.h"

@interface HMDidTreatTableViewController ()



@property (nonatomic, strong)NSMutableArray *dataArr;

@end


static NSString *idCell = @"cell";
@implementation HMDidTreatTableViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    _dataArr = [NSMutableArray array];
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:idCell];
    
    //下拉刷新
    self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        //刷新指定时间完成
        [NSThread sleepForTimeInterval:1.3];
        [self.tableView.mj_header endRefreshing];
        
    }];
    
    //上拉刷新
    self.tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
        //刷新指定时间完成
        [NSThread sleepForTimeInterval:1.3];
        [self.tableView.mj_footer endRefreshing];
        
    }];
    
}



#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 3;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:idCell forIndexPath:indexPath];
    
    NSArray *arr = @[@"手术治疗",@"药物治疗",@"保守观察"];
    
    for (NSInteger i = 0; i < indexPath.row + 1; i++) {
        cell.textLabel.text = arr[i];
    }

    return cell;
}

- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    

     NSArray *arr = @[@"手术治疗",@"药物治疗",@"保守观察"];
    [self.delegate HMDidTreatTableViewController:self andStr:arr[indexPath.row]];
    [self.navigationController popViewControllerAnimated:YES];
}

@end
